<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
      <el-form-item label="服务器名称" prop="serverName">
        <el-input
          v-model="queryParams.serverName"
          placeholder="请输入服务器名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="服务器IP" prop="serverIp">
        <el-input
          v-model="queryParams.serverIp"
          placeholder="请输入服务器IP"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
          <el-option
            v-for="dict in dict.type.fo_server_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['yipaiju:server_manage:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['yipaiju:server_manage:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['yipaiju:server_manage:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['yipaiju:server_manage:export']"
        >导出</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-circle-close"
          size="mini"
          @click="handleSpiderShutdowns"
          v-hasPermi="['yipaiju:server_manage:shutdown']"
        >停止</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-position"
          size="mini"
          @click="handleArranges"
          v-hasPermi="['yipaiju:server_manage:arrange']"
        >部署</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="server_manageList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
<!--      <el-table-column label="id" align="center" prop="id" />-->
<!--      <el-table-column label="服务器名称" align="center" prop="serverName" :show-overflow-tooltip='true'/>-->
      <el-table-column label="服务器IP" align="center" prop="serverIp" />
<!--      <el-table-column label="账号" align="center" prop="account" />-->
<!--      <el-table-column label="密码" align="center" prop="password" :show-overflow-tooltip='true'/>-->
<!--      <el-table-column label="淘宝账号" align="center" prop="taobaoAccount" :show-overflow-tooltip='true'/>-->
      <el-table-column label="抓取省份" align="center" prop="grabProvince" :show-overflow-tooltip='true'/>
      <el-table-column label="抓取城市" align="center" prop="grabCity" :show-overflow-tooltip='true'/>
<!--      <el-table-column label="线程数" align="center" prop="threadNum" />-->
<!--      <el-table-column label="代理接口" align="center" prop="proxyipUrl" :show-overflow-tooltip='true'/>-->
<!--      <el-table-column label="爬取城市" align="center" prop="grabCity" />-->
<!--      <el-table-column label="地域" align="center" prop="serverCity" />-->
      <el-table-column label="爬取类型" align="center" prop="grabTypes">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.fo_foreclosed_house_status" :value="scope.row.grabTypes"/>
        </template>
      </el-table-column>
      <el-table-column label="爬取模式" align="center" prop="grabMolds">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.fo_server_grab_mold" :value="scope.row.grabMolds"/>
        </template>
      </el-table-column>
      <el-table-column label="状态" align="center" prop="status">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.fo_server_status" :value="scope.row.status"/>
        </template>
      </el-table-column>
<!--      <el-table-column label="省队列" align="center" prop="queueProvCount" :show-overflow-tooltip='true'/>-->
      <el-table-column label="阿里" align="center" prop="queueDetailCount" />
      <el-table-column label="京东" align="center" prop="queueDetailCountJd" />
      <el-table-column label="公拍网" align="center" prop="queueDetailCountGpw" />
      <el-table-column label="中拍平台" align="center" prop="queueDetailCountZppt" />
      <el-table-column label="诉讼资产网" align="center" prop="queueDetailCountSszcw" />
      <el-table-column label="工商银行" align="center" prop="queueDetailCountIcbc" />
      <el-table-column label="北交互联" align="center" prop="queueDetailCountCbex" />
      <el-table-column label="描述" align="center" prop="ext1" :show-overflow-tooltip='true'/>
<!--      <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip='true'/>-->



<!--      <el-table-column label="SDK目录" align="center" prop="sdkPath" :show-overflow-tooltip='true'/>-->
<!--      <el-table-column label="程序目录" align="center" prop="codePath" :show-overflow-tooltip='true'/>-->
<!--      <el-table-column label="工作目录" align="center" prop="workPath" :show-overflow-tooltip='true'/>-->

<!--      <el-table-column label="爬取次数" align="center" prop="runCount" />-->
<!--      <el-table-column label="爬虫版本" align="center" prop="spiderVersion" />-->
<!--      <el-table-column label="ext1" align="center" prop="ext1" />-->
<!--      <el-table-column label="ext2" align="center" prop="ext2" />-->
<!--      <el-table-column label="ext3" align="center" prop="ext3" />-->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['yipaiju:server_manage:edit']"
          >修改</el-button>

          <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" >
                <span class="el-dropdown-link">
                  <i class="el-icon-d-arrow-right el-icon--right"></i>更多
                </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="handleClearQueue" icon="el-icon-brush"
                                v-hasPermi="['yipaiju:server_manage:clearqueue']">清空队列</el-dropdown-item>
              <el-dropdown-item command="handleArrange" icon="el-icon-position"
                                v-hasPermi="['yipaiju:server_manage:arrange']">远程部署</el-dropdown-item>
              <el-dropdown-item command="handleAddprov" icon="el-icon-document-copy"
                                v-hasPermi="['yipaiju:server_manage:addprov']">爬列表</el-dropdown-item>
              <el-dropdown-item command="handleAdddetailAli" icon="el-icon-document"
                                v-hasPermi="['yipaiju:server_manage:adddetail']">爬详情</el-dropdown-item>
<!--              <el-dropdown-item command="handleAdddetailJd" icon="el-icon-document"-->
<!--                                v-hasPermi="['yipaiju:server_manage:adddetail']">爬京东</el-dropdown-item>-->
              <el-dropdown-item command="handleSpiderStart" icon="el-icon-video-play"
                                v-hasPermi="['yipaiju:server_manage:start']">启动</el-dropdown-item>
              <el-dropdown-item command="handleSpiderShutdown" icon="el-icon-circle-close"
                                v-hasPermi="['yipaiju:server_manage:shutdown']">停止</el-dropdown-item>
              <el-dropdown-item command="handleRestartProv" icon="el-icon-refresh-right"
                                v-hasPermi="['yipaiju:server_manage:restartprov']">重启列表</el-dropdown-item>
              <el-dropdown-item command="handleRestartDetail" icon="el-icon-refresh-right"
                                v-hasPermi="['yipaiju:server_manage:restartdetail']">重启详情</el-dropdown-item>
              <el-dropdown-item command="handleSynchQueue" icon="el-icon-refresh"
                                v-hasPermi="['yipaiju:server_manage:synchqueue']">同步队列</el-dropdown-item>
              <el-dropdown-item command="handleDelete" icon="el-icon-delete"
                                v-hasPermi="['yipaiju:server_manage:remove']">删除</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改服务器对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">

        <el-row>
          <el-col :span="12">
            <el-form-item label="服务器名称" prop="serverName">
              <el-input v-model="form.serverName" placeholder="请输入服务器名称" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="服务器IP" prop="serverIp">
              <el-input v-model="form.serverIp" placeholder="请输入服务器IP" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="账号" prop="account">
              <el-input v-model="form.account" placeholder="请输入账号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="密码" prop="password">
              <el-input v-model="form.password" placeholder="请输入密码" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="淘宝账号" prop="taobaoAccount">
              <el-input v-model="form.taobaoAccount" placeholder="请输入淘宝账号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="线程数" prop="threadNum">
              <el-input v-model="form.threadNum" placeholder="请输入线程数" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="抓取省份" prop="grabProvince">
              <el-input v-model="form.grabProvince" placeholder="请输入抓取省份|抓取页数" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="抓取城市" prop="grabCity">
              <el-input v-model="form.grabCity" placeholder="请输入抓取城市" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="抓取区" prop="grabDistrict">
              <el-input v-model="form.grabDistrict" placeholder="请输入抓取区" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="房源类型" prop="houseType">
              <el-input v-model="form.houseType" placeholder="请输入房源类型" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="开始页数" prop="grabPage">
              <el-input v-model="form.grabPage" placeholder="请输入抓取开始页数" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="阿里代理" prop="proxyipUrl">
              <el-input v-model="form.proxyipUrl" placeholder="请输入代理接口" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="中拍平台" prop="proxyipUrlZppt">
              <el-input v-model="form.proxyipUrlZppt" placeholder="请输入代理接口" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="爬取类型" prop="grabTypes">
              <el-select v-model="form.grabTypes" placeholder="请选择爬取类型" clearable multiple>
                <el-option
                  v-for="dict in dict.type.fo_foreclosed_house_status"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="爬取模式" prop="grabMolds">
              <el-select v-model="form.grabMolds" placeholder="请选择爬取模式" multiple>
                <el-option
                  v-for="dict in dict.type.fo_server_grab_mold"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="地域" prop="serverCity">
              <el-input v-model="form.serverCity" placeholder="请输入地域" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="描述" prop="ext1">
              <el-input v-model="form.ext1" placeholder="请输入描述" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="状态" prop="status">
              <el-select v-model="form.status" placeholder="请选择状态">
                <el-option
                  v-for="dict in dict.type.fo_server_status"
                  :key="dict.value"
                  :label="dict.label"
                  :value="parseInt(dict.value)"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="备注" prop="remark">
              <el-input v-model="form.remark" placeholder="请输入备注" />
            </el-form-item>
          </el-col>
        </el-row>

<!--        <el-form-item label="SDK目录" prop="sdkPath">-->
<!--          <el-input v-model="form.sdkPath" placeholder="请输入SDK目录" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="程序目录" prop="codePath">-->
<!--          <el-input v-model="form.codePath" placeholder="请输入程序目录" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="工作目录" prop="workPath">-->
<!--          <el-input v-model="form.workPath" placeholder="请输入工作目录" />-->
<!--        </el-form-item>-->

<!--        <el-form-item label="爬取次数" prop="runCount">-->
<!--          <el-input v-model="form.runCount" placeholder="请输入爬取次数" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="爬虫版本" prop="spiderVersion">-->
<!--          <el-input v-model="form.spiderVersion" placeholder="请输入爬虫版本" />-->
<!--        </el-form-item>-->

<!--        <el-form-item label="ext2" prop="ext2">-->
<!--          <el-input v-model="form.ext2" placeholder="请输入ext2" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="ext3" prop="ext3">-->
<!--          <el-input v-model="form.ext3" placeholder="请输入ext3" />-->
<!--        </el-form-item>-->
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog :title="'请空列表'" :visible.sync="clearQueueOpen" width="500px" append-to-body>
      <el-form>
        <el-form-item label="请空队列" prop="">
          <el-select v-model="clearQueueName" placeholder="请选择需要请空的队列" >
            <el-option
              v-for="dict in dict.type.fo_spider_queue"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>

      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitClearQueue">确 定</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
import { listServer_manage, getServer_manage, delServer_manage, addServer_manage, updateServer_manage, serverAddprov, serverAdddetail, serverClearQueue, serverSpiderArrange, serverSpiderArranges, serverSynchQueue, serverSpiderStart, serverSpiderShutdown, serverSpiderShutdowns } from "@/api/yipaiju/server_manage";

export default {
  name: "Server_manage",
  dicts: ['fo_foreclosed_house_status', 'fo_server_status', 'fo_server_grab_mold', 'fo_spider_queue'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 服务器表格数据
      server_manageList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      clearQueueOpen: false,
      clearQueueName: null,
      clearQueueId: null,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        serverName: null,
        serverIp: null,
        lanIp: null,
        account: null,
        password: null,
        taobaoAccount: null,
        grabProvince: null,
        grabCity: null,
        grabDistrict: null,
        grabType: null,
        grabMold: null,
        grabPage: null,
        houseType: null,
        status: null,
        runCount: null,
        spiderVersion: null,
        remark: null,
        serverCity: null,
        threadNum: null,
        proxyipUrl: null,
        proxyipUrlJd: null,
        proxyipUrlZppt: null,
        ext1: null,
        ext2: null,
        ext3: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询服务器列表 */
    getList() {
      this.loading = true;
      listServer_manage(this.queryParams).then(response => {
        this.server_manageList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        serverName: null,
        serverIp: null,
        lanIp: null,
        account: null,
        password: null,
        taobaoAccount: null,
        grabProvince: null,
        grabCity: null,
        grabDistrict: null,
        grabType: null,
        grabMold: null,
        grabPage: null,
        houseType: null,
        status: null,
        runCount: null,
        spiderVersion: null,
        remark: null,
        serverCity: null,
        threadNum: null,
        proxyipUrl: null,
        queueProvCount: null,
        queueDetailCount: null,
        sdkPath: null,
        codePath: null,
        workPath: null,
        ext1: null,
        ext2: null,
        ext3: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      // this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加服务器";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getServer_manage(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改服务器";
      });
    },
    handleAddprov(row) {
      let that = this;
      const id = row.id
      this.$modal.confirm('是否确认执行此操作').then(function() {
        return serverAddprov(id);
      }).then(() => {
        that.$modal.msgSuccess("执行成功");
        that.getList();
      }).catch(() => {})
    },
    // origin参数没用了  放这放着吧
    handleAdddetail(row, origin) {
      let that = this;
      const id = row.id
      this.$modal.confirm('是否确认执行此操作').then(function() {
        return serverAdddetail({id: id, origin: origin});
      }).then(() => {
        that.$modal.msgSuccess("执行成功");
        that.getList();
      }).catch(() => {})
    },
    handleSynchQueue(row) {
      let that = this;
      const id = row.id
      this.$modal.confirm('是否确认执行此操作').then(function() {
        return serverSynchQueue(id);
      }).then(() => {
        that.$modal.msgSuccess("执行成功");
        that.getList();
      }).catch(() => {});
    },
    submitClearQueue(){
      this.handleClearQueue(this.clearQueueId, this.clearQueueName);
      this.clearQueueOpen = false;
    },
    handleClearQueue(id, queuePrefix) {
      let that = this;
      this.$modal.confirm('是否确认请除详情队列').then(function() {
        return serverClearQueue({id: id, queuePrefix: queuePrefix});
      }).then(() => {
        that.$modal.msgSuccess("执行成功");
        that.getList();
      }).catch(() => {});
    },
    handleArrange(row){
      let that = this;
      const id = row.id
      this.$modal.confirm('是否确认更新爬虫程序').then(function() {
        return serverSpiderArrange(id);
      }).then(() => {
        that.$modal.msgSuccess("执行成功");
      }).catch(() => {});
    },
    handleArranges(row){
      let that = this;
      const ids = this.ids;
      if (ids.length > 0){
        this.$modal.confirm('是否确认执行此操作').then(function() {
          return serverSpiderArranges(ids);
        }).then(() => {
          that.$modal.msgSuccess("执行成功");
        }).catch(() => {});
      }else {
        that.$modal.msgError("请至少选择一个");
      }
    },
    handleSpiderStart(row){
      let that = this;
      const id = row.id
      this.$modal.confirm('是否确认执行此操作').then(function() {
        return serverSpiderStart(id);
      }).then(() => {
        that.$modal.msgSuccess("执行成功");
      }).catch(() => {});
    },
    handleSpiderShutdown(row){
      let that = this;
      const id = row.id
      this.$modal.confirm('是否确认执行此操作').then(function() {
        return serverSpiderShutdown(id);
      }).then(() => {
        that.$modal.msgSuccess("执行成功");
      }).catch(() => {});
    },
    handleSpiderShutdowns(){
      let that = this;
      const ids = this.ids;
      if (ids.length > 0){
        this.$modal.confirm('是否确认执行此操作').then(function() {
          return serverSpiderShutdowns(ids);
        }).then(() => {
          that.$modal.msgSuccess("执行成功");
        }).catch(() => {});
      }else {
        that.$modal.msgError("请至少选择一个");
      }
    },

    // 更多操作触发
    handleCommand(command, row) {
      switch (command) {
        case "handleClearQueue":
          this.clearQueueId = row.id;
          this.clearQueueOpen = true;
          // this.handleClearQueue(row, 'AliProvQueue');
          break;
        case "handleArrange":
          this.handleArrange(row);
          break;
        case "handleAddprov":
          this.handleAddprov(row);
          break;
        case "handleAdddetailAli":
          this.handleAdddetail(row, '阿里法拍');
          break;
        case "handleAdddetailJd":
          this.handleAdddetail(row, '京东法拍');
          break;
        case "handleRestartProv":
          // this.handleRestartProv(row);
          this.$modal.msgError("努力开发中...");
          break;
        case "handleRestartDetail":
          // this.handleRestartDetail(row);
          this.$modal.msgError("努力开发中...");
          break;
        case "handleSpiderStart":
          this.handleSpiderStart(row);
          break;
        case "handleSpiderShutdown":
          this.handleSpiderShutdown(row);
          break;
        case "handleSynchQueue":
          this.handleSynchQueue(row);
          break;
        case "handleDelete":
          this.handleDelete(row);
          break;
        default:
          break;
      }
    },

    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateServer_manage(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addServer_manage(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除服务器编号为"' + ids + '"的数据项？').then(function() {
        return delServer_manage(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('yipaiju/server_manage/export', {
        ...this.queryParams
      }, `server_manage_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
